import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_douban/config/app_colors.dart';
import 'package:flutter_douban/model/topic_model.dart';

class TopicView extends StatelessWidget {
  final TopicModel model;
  const TopicView({Key? key, required this.model}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(left: 30, right: 30),
      color: AppColors.white,
      child: Column(
        children: [
          SizedBox(
            height: 10,
          ),
          Row(
            children: [
              ClipRRect(
                child: CachedNetworkImage(
                  imageUrl: model.cover_image!,
                  fit: BoxFit.cover,
                  width: 65,
                  height: 65,
                ),
                borderRadius: BorderRadius.circular(4),
              ),
              SizedBox(width: 15,),
              Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    model.name!,
                    style: TextStyle(
                        fontWeight: FontWeight.w400,
                        fontSize: 14,
                        color: Colors.black),
                  ),
                  SizedBox(height: 5,),
                  Text(
                    model.content_count!.toString()+'篇笔记',
                    style: TextStyle(
                        fontWeight: FontWeight.w300,
                        fontSize: 12,
                        color: AppColors.black),
                  )
                ],
              )
            ],
          ),
          SizedBox(
            height: 10,
          )
        ],
      ),
    );
  }
}
